using DA.AnimGraph;
using UnityEngine.UIElements;

namespace DA.AnimGraph.Editor {

    internal class InspectorField_BlackboardEntryType : InspectorField<RefField<AGABlackboardType>> {

        EnumField enumField;

        protected override void BuildUI() {
            enumField = new EnumField(labelText);
            enumField.Init(source.value);
            //enumField.value = source.value;
            enumField.RegisterValueChangedCallback(evt => {
                source.value = (AGABlackboardType)evt.newValue;
                inspectorChangeCallback?.Invoke();
            });
        }

        protected override void DrawUI() {
            Add(enumField);
        }
    }
}
